<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>随机显示文字</title>
</head>
<body>
	<h1>随机显示文字</h1><hr>
	<script type="text/javascript">
		var myArr = new Array("1", "2", "3", "4", "5");
		
		var i = Math.floor(Math.random()*(myArr.length));
		document.write(myArr[i]);
	</script>
</body>
</html>